package com.atguigu.gmall.product.service.impl;

import com.atguigu.gmall.cache.annotation.GmallCache;
import com.atguigu.gmall.model.item.to.CategoryView;
import com.atguigu.gmall.model.product.to.CategoryTreeTo;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.atguigu.gmall.model.product.entity.BaseCategory1;
import com.atguigu.gmall.product.service.BaseCategory1Service;
import com.atguigu.gmall.product.mapper.BaseCategory1Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
* @author lyd
* @description 针对表【base_category1(一级分类表)】的数据库操作Service实现
* @createDate 2025-03-10 20:57:08
*/
@Service
public class BaseCategory1ServiceImpl extends ServiceImpl<BaseCategory1Mapper, BaseCategory1>
    implements BaseCategory1Service{

    @GmallCache(key = "categories")
    @Override
    public List<CategoryTreeTo> getCategoryTreeTo() {
        return baseMapper.getCategoryTreeTo();
    }

    @Override
    public CategoryView getCategoryView(Long category3Id) {
        return baseMapper.getCategoryView(category3Id);
    }
}




